<!-- TEMPLATE CONTRAT RECHERCHER -->

<section id="content">

    <!-- Tableau obligatoire ! Structure du calendrier ! -->
    <table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;">
        <tr>
            <td id="ds_calclass"></td>
        </tr>
    </table>

    <!-- -->

    <h1 class="article">{#CONTRAT_RECHERCHER#}</h1>

    <form class="article buttons" name="ContratRechercher" method="post" action="?action=rechercherContrat">
        
        <fieldset class="form-text">
            <label>{#ANIMAL_NO#}</label>
            <input type="text" name="animal_id" />
        </fieldset>
        
        <fieldset class="form-text">
            <label>{#PERSONNE_NO#}</label>
            <input type="text" name="personne_id" /><br/>
        </fieldset>
        
        <fieldset>
            <label>{#TYPE_CONTRAT#}</label>
            <select name="type">
                <option value=""></option>
                <option value="pension">{#PENSION#}</option>
                <option value="adoptionprovisoire">{#ADOPTION_PROV#}</option>
                <option value="cessionpropriete">{#CESSION_PROP#}</option>
                <option value="placement">{#PLACEMENT#}</option>
                <option value="restitution">{#RESTITUTION#}</option>
            </select>
        </fieldset>
            
        
        <fieldset class="form-text">
            <label>{#LIEU#}</label>
            <input type="text" name="lieu" />
        </fieldset>    
        
        <fieldset class="form-text date">
            <label>{#DATE#}</label> 
            <p>{#ENTRE#}<p>
            <input id="correction1" type="text" name="DateContrat" onClick="ds_sh(this);"/> 
            <p>{#ET#}</p> 
            <input type="text" name="DateContrat" onClick="ds_sh(this);"/>
        </fieldset>
            
        <fieldset class="form-actions">
            <input type="submit" name="Rechercher" value="{#RECHERCHER#}">
        </fieldset>

    </form>
        
    <h2 class="article">{#RESULTAT_RECHERCHE#}</h2>

    <table id="tableauRecherche" class="article">
        <thead>
            <tr>
                <th width="30px">{#ID#}</th>
                <th width="100px">Date</th>
                <th width="100px">Lieu</th>
                {if (isset($type)) && ($type eq 'pension')}
                <th></th>
                {/if}
            </tr> 
        </thead>
        <tbody>
            {if isset($listeContrats)}
                {foreach from=$listeContrats item=record }
                    <tr class="{cycle values="ligne1,ligne2"}">
                        <td><a href ="?action=afficherPersonne&id={$record->getId()}">{$record->getId()}</a></td>
                        <td>{$record->getDate()}</td>
                        <td>{$record->getLieu()}</td>
                        {if (isset($type)) && ($type eq 'pension')}
                        <td><a href="http://localhost/trunk/includes/interface/fPDF/ACAcontratAdaption.php" target="blank">PDF</a></td>
                        {/if}
                    </tr>

                {/foreach}    
            {/if}     
        </tbody>  
    </table>         
    </section>